<template>
	<view>
		<!-- <view class="tabbar">
			<view @click="tabbar_activeNum =1" class="body">
				<image :src="1==tabBarIndex?home1:home2"></image>
				<view class="tabbar_title" :class="{tabbar_active:tabBarIndex==1}">首页</view>
			</view>
			<view @click="tabbar_activeNum=2" class="body">
				<image :src="2==tabBarIndex?active1:active2"></image>
				<view class="tabbar_title" :class="{tabbar_active:tabBarIndex==2}">医生</view>
			</view>
 
			<view @click="tabbar_activeNum=3" class="body">
				<image :src="3==tabBarIndex?shop1:shop2"></image>
				<view class="tabbar_title" :class="{tabbar_active:tabBarIndex==3}">商城</view>
			</view>
			<view @click="tabbar_activeNum=4" class="body">
				<image :src="4==tabBarIndex?user1:user2"></image>
				<view class="tabbar_title" :class="{tabbar_active:tabBarIndex==4}">我的</view>
			</view>
		</view>
		<view class="item_body " v-if="tabbar_activeNum ==5"  @click="tabbar_activeNum=9">
			<view class="bg-white submit_bottom align-center " @click.stop>
				<view class="" style="width: 750rpx;">
					<view class="item_bottom rowsb  text-center align-center">
						<view class="item_wrap pdBtm20">
							<block v-for="(item,index) in list" :key="index">
								<view @click="navtopage(index)" style="width: 25%;" class="tct pdTop30 pdBtm10">
									<view>
										 
										<image class="item_img" :src="item.image"></image>
									</view>
									<view class="margin-top-sm">{{item.title}}</view>
								</view>
							</block>
						</view>
					</view>
					<view class="rowsc padding margin-top">
						<view @click="closeMen()" class="close"></view>
					</view>
				</view>
			</view>
		</view> -->

	</view>
</template>

<script>
	export default {
		name: "tabbar",
		props:{
			tabBarIndex:Number
		},
		data() {
			return {
				tabbar_activeNum: 0,
				// 首页
				home1: '/static/tabbar/icon_zixunx.png',
				home2: '/static/tabbar/icon_zixunm.png',
				//活动
				active1: '/static/tabbar/icon_zhuanjaixuan.png',
				active2: '/static/tabbar/icon_zhuanjiam.png',
				//发布
				issue: '/static/tabbar/icon_fabu.png',
				//商城
				shop1: '/static/tabbar/icon_gouwuchex.png',
				shop2: '/static/tabbar/icon_gouwuchem.png',
				//我的
				user1: '/static/tabbar/icon_wodex.png',
				user2: '/static/tabbar/icon_wodem.png',
				list: [{
						title: '医疗资讯',
						image: '/static/tabbar/icon_yiliao.png'
					},
					{
						title: '病案讨论',
						image: '/static/tabbar/icon_bingan.png'
					},
					{
						title: '招贤纳士',
						image: '/static/tabbar/icon_zhaoxian.png'
					},
					{
						title: '出租转让',
						image: '/static/tabbar/icon_zhuanrang.png'
					},
				],
			};
		},
		watch: {
			tabbar_activeNum(event) {
				if (event == 1) {
					uni.reLaunch({
						url: '/pages/home/index'
					})
				} else if (event == 2) {
					uni.reLaunch({
						url: '/pages/doctor/index'
					})
				} else if (event == 3) {
					uni.reLaunch({
						url: '/pages/shop/index'
					})
				} else if (event == 4) {
					uni.reLaunch({
						url: '/pages/user/index'
					})
				}
			}
		},
		methods:{
			closeMen(){
				this.tabbar_activeNum = 6
			},
			navtopage(index) {
				switch (index) {
					case 0:
						this.$tools.goNext('/pages/plugins/informationFrom')
						break;
					case 1:
						this.$tools.goNext('/pages/disease/diseaseDiscussion')
						break;
					case 2:
						this.$tools.goNext('/pages/recruit/recruitList')
						break;
					case 3:
						this.$tools.goNext('/pages/rentout/equipmentTransfer')
						break;
					default:
						break;
				}
			}
		}
	}
</script>

<style lang="scss">
	.tabbar {
		z-index: 9999;
		width: 750rpx;
		height: 120rpx;
		background: #FFFFFF;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		display: flex;
		justify-content: space-between;
		padding-left: 50rpx;
		padding-right: 50rpx;
		text-align: center;
		align-items: center;

		.body {

			image {
				height: 44rpx;
				width: 44rpx;
			}
			.issue{
				width: 68rpx;
				height: 68rpx;
				opacity: 1;
			}


			.tabbar_title {
				font-size: 38rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #5B5E63;
				opacity: 1;
			}
		}
	}

	.tabbar_active {
		color: #1573E7 !important;
	}
	
	
	
	
	
	
	.item_wrap {
		width: 100%;
		display: flex;
		flex-wrap: wrap;
		overflow: hidden;
	}
	
	.item_body {
		position: fixed;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		background: rgba(0, 0, 0, 0.4);
		z-index: 9999;
	}
	
	.submit_bottom {
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		width: 750rpx;
		height: 430rpx;
		background: #FFFFFF;
		opacity: 1;
		border-radius: 31rpx 31rpx 0px 0px;
	}
	
	.item_img {
		width: 82rpx;
		height: 82rpx;
	}
	
	.close {
		width: 50rpx;
		height: 50rpx;
		// closeicons
		// background-image: url(close);
		background-repeat: no-repeat;
		background-size: 100% 100%;
	}
</style>
